package com.eastfair.venueservice.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.request.PageParams;
import com.eastfair.boot.service.SuperService;
import com.eastfair.venueservice.dto.ServiceBorrowReturnDTO;
import com.eastfair.venueservice.dto.ServiceInventoryInFlowDTO;
import com.eastfair.venueservice.dto.ServiceLossDTO;
import com.eastfair.venueservice.entity.ServiceLoss;
import com.eastfair.venueservice.vo.ServiceLossVO;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 业务接口
 * 报损记录
 * </p>
 *
 * @author linan
 * @date 2022-09-19
 */
public interface ServiceLossService extends SuperService<ServiceLoss> {

    /**
     * 分页查询报损记录VO列表.
     *
     * @param pageParams the page params
     * @return the page
     */
    Page<ServiceLossVO> listServiceLossVO(PageParams<ServiceLossDTO> pageParams);

    /**
     * 查询报损记录列表.
     *
     * @param serviceLossDTO the service loss dto
     * @return the list
     */
    List<ServiceLoss> listServiceLoss(ServiceLossDTO serviceLossDTO);

    /**
     * 保存报损记录.
     *
     * @param serviceLossDTO the service loss
     * @return the boolean
     */
    boolean saveServiceLoss(ServiceLossDTO serviceLossDTO);

    /**
     * 更新报损记录.
     *
     * @param serviceLossDTO the service loss
     * @return the boolean
     */
    boolean updateServiceLoss(ServiceLossDTO serviceLossDTO);

    /**
     * 归还报损.
     *
     * @param serviceBorrowReturnDTO the service borrow return dto
     * @return the boolean
     */
    boolean returnServiceLoss(ServiceBorrowReturnDTO serviceBorrowReturnDTO);

    /**
     * 入库报损.
     *
     * @param serviceInventoryInFlowDTO the service inventory in flow dto
     * @return the boolean
     */
    boolean inventoryInFlowLoss(ServiceInventoryInFlowDTO serviceInventoryInFlowDTO);

    /**
     * 返修入库.
     *
     * @param serviceLossDTO the service loss dto
     * @return the boolean
     */
    boolean repairInInventory(ServiceLossDTO serviceLossDTO);

    /**
     * 报损类型统计.
     *
     * @param serviceLossDTO the service loss dto
     * @return the map
     */
    Map<String, Object> countLossNumByGoodsLossState(ServiceLossDTO serviceLossDTO);
}
